package com.icongyou.enterprise.auth.controller;

import com.icongyou.enterprise.auth.entity.dto.LoginDto;
import com.icongyou.enterprise.auth.entity.vo.LoginUserVo;
import com.icongyou.enterprise.auth.service.AuthService;
import com.icongyou.enterprise.common.result.Result;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/auth")
@RequiredArgsConstructor
public class AuthController {

    @Autowired
    private AuthService authService;

    @PostMapping("/login")
    public Result<LoginUserVo> login(@Valid @RequestBody LoginDto loginDto) {
        return authService.login(loginDto);
    }

}